#pragma once

#include "DesignerWidget.h"
#include "DataPublic.h"
#include "UIBaseTool/Export"

class UIBaseTool_EXPORT  OcUiDockingControlBarFactory : public OcRxFactory<DesignerDlgTypePublic, DesignerWidget>
{
public:
	OcUiDockingControlBarFactory(DesignerDlgTypePublic type);
  virtual ~OcUiDockingControlBarFactory(void);

public:
	virtual DesignerWidget * Creat(void* pData = NULL) = 0;
	virtual void destroy(DesignerWidget *Obj, void* pData = NULL);
};

#define RegistOcUiDockControlBarBaseFactory(ClassData, DOCKINGCONTROLBARIDTYPE) \
class  ClassData##OcUiDockControlBarBase : public OcUiDockingControlBarFactory \
{ \
public: \
  ClassData##OcUiDockControlBarBase(void): \
    OcUiDockingControlBarFactory(DOCKINGCONTROLBARIDTYPE) \
    { \
      g_pDockingControlBar->RegisitFactory(mType, this); \
    } \
    virtual ~ClassData##OcUiDockControlBarBase(void){;} \
    \
public: \
	virtual DesignerWidget * Creat(void* pData) \
  { \
  DesignerWidget * pDockControlBar = new ClassData((QWidget*)pData); \
    return  pDockControlBar; \
  } \
}; \
	ClassData##OcUiDockControlBarBase* __ClassData##OcUiDockControlBarBase = new ClassData##OcUiDockControlBarBase(); \

